package com.stedu.mall.common.service;

import com.stedu.mall.common.bean.Cart;
import com.stedu.mall.common.exception.SteduException;

import java.util.List;

public interface CartService {
    //添加
    boolean insert(Cart cart);
    //修改
    boolean update(Cart cart,Integer userId) throws SteduException;
    //删除
    boolean delete(Integer id,Integer userId) throws SteduException;
    //搜索
    List<Cart> serach(Cart condition);
    //根据id查询
    Cart selectById(Integer id);
    //根据userid清空购物车
    boolean deleteByUserId(Integer userId);
    //批量删除
    boolean deleteByIds(List<Integer> ids,Integer userId);
    //批量查询
    List<Cart> selectByIds(Integer[] cartIds,Integer userId) throws SteduException;

}
